1. Field
The following description relates to a web browsing technology for a multi-core processor that is capable of improving the execution performance of JAVASCRIPT® code.
2. Description of the Related Art
Recently, Asynchronous JAVASCRIPT® and XML (AJAX) have emerged for implementing web applications that are comparable to desktop applications, such as GOOGLE® Docs or GOOGLE® Maps, and have been used for WEB 2.0. In a conventional web environment, JAVASCRIPT® has been used to perform only a simple code that accesses a Data Object Model (DOM) object. However, with the change of the internet environment, for example, following the arrival of AJAX, the execution performance of JAVASCRIPT® has been gaining importance for implementing a web browser.
Full web browsing is widely used not only in the desktop environment but also in the embedded environment, such as a mobile phone, an IPTV, and the like. Different from the desktop environment, the embedded environment typically does not provide sufficient hardware resources for a full browsing web browser. For this reason, high performance JAVASCRIPT® engine has garnered a large amount of interest.
While keeping with such a change, various types of high performance engines have been released. TraceMonkey built in MOZILLA® FIREFOX®, V8 built in GOOGLE® Chrome, and SquirrelFish Extreme WebKit are some of the various engines. These engines use the Just-In-Time (JIT) compile technique, in which a JIT compiler compiles source code into machine code in real time. The JIT compile technique may improve the execution performance of an application written in JAVASCRIPT®.
However, such JAVASCRIPT® engines have limitations in achieving the high performance. For example, because the JIT compiler compiles the source code during execution of the application, the compilation time is not separated from the execution time. Therefore, there is a need for a compiling technique capable of reducing the compilation time as much as possible.
In order to satisfy the requirement of a compiling operation and to perform the compiling operation in as short of amount of time as possible, the JIT compiler does not perform optimization that is performed in a general compiler. This omission results in the generation of inefficient machine codes. In addition, after a machine code generated in the JAVASCRIPT® engine is released from a main memory, if the corresponding machine code is desired, the JAVASCRIPT® engine needs to perform compilation again causing an increase overhead.
In addition, the language characteristic of the JAVASCRIPT® has become a limiting factor to the high performance of the JAVASCRIPT® engine. JAVASCRIPT® is an object oriented language and tends to have short functions (procedures).
In addition, because JAVASCRIPT® is a dynamic typed language, a simple operation, such as an access to a property of an object, is achieved through a function invocation. The property may be dynamically added to an object or deleted from an object in JAVASCRIPT®.
Before the execution of the JAVASCRIPT® program, the location of a predetermined property of an object is unknown. A simple operation such as an access to a property of an object may be achieved through a stub code that is dynamically generated during execution. For this reason, the function invocation may occur very frequently in a JAVASCRIPT® program.
Before the actual execution of the JAVASCRIPT® program, the engine does not know which function is to be invoked in a call site. As a result, the program engine takes a lot of time to perform optimization for the frequent function invocations.
Due to these characteristics of JAVASCRIPT®, it is difficult for a JAVASCRIPT® engine to apply a typical compiler optimization method, such as inlining and inter-procedural analysis, to the frequent function invocations in a JAVASCRIPT® program. Accordingly, the machine code generated in the JAVASCRIPT® engine is less effective than the machine code that is obtained by compiling a code that is written in a static type language, such as C.
In addition, the use of multi-core processors has spread not only in the desktop environment but also in the embedded environment, but the conventional JAVASCRIPT® engine does not effectively use the multi-core processors in a system. For example, the JAVASCRIPT® program does not support a multithread operation. Accordingly, there are spare cores that are not being used in a system.